package com.fyt.recover.order;

public class InsertOrder {

    public static void test(int[] arr){


        for (int i = 1; i <arr.length ; i++) {
            int temp=arr[i];

           int j=i-1;
            while (j>=0&&arr[j]>temp){     // arr[i]会被覆盖
                arr[j+1]=arr[j];
                j--;

            }

            arr[j+1]=temp;
        }

        for (int i = 0; i <arr.length ; i++) {
            System.out.println(arr[i]);
        }

    }
}
